<template>
	<div class="AddCompany">
		<el-breadcrumb separator="/">
			<el-breadcrumb-item :to="{ path: '/dataExpress' }"><i class="lh fw_300 lh-seller fz_20"></i></el-breadcrumb-item>
			<el-breadcrumb-item>B端-商户</el-breadcrumb-item>
			<el-breadcrumb-item>店铺管理</el-breadcrumb-item>
		</el-breadcrumb>
		<div class="content_Box box-shadow mt_15 pl_10 pr_10">
			<el-tabs type="border-card">
				<el-tab-pane label="基本信息">
					<div class="contentInfo">
						<div class="pt_10">
							<div class="row-info clear">
								<div class="fl title-key"><i class="lhadmin lhadmin-wujiaoxing"></i>所属商户</div>
								<div class="fl list-cont">
									<el-autocomplete
										class="inline-input"
										v-model="dataMes.business_name"
										:fetch-suggestions="querySearch_s"
										placeholder="请输入"
										:trigger-on-focus="true"
										@select="handleSelect_s"
									></el-autocomplete>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key mt_15">店铺Logo/门头照</div>
								<div class="fl list-cont">
									<uploadedit pic_name="'dataMes.logo'" :pic_url="dataMes.logo" @func="img5"></uploadedit>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key"><i class="lhadmin lhadmin-wujiaoxing"></i>店铺名称</div>
								<div class="fl list-cont">
									<el-input v-model="dataMes.name" placeholder="请输入"></el-input>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key"><i class="lhadmin lhadmin-wujiaoxing"></i>所属行业</div>
								<div class="fl list-cont">
									<el-select v-model="dataMes.industry">
										<el-option
											v-for="(item, index) in industryJobList"
											:key="index"
											:label="item.label_name"
											:value="item.id"
										></el-option>
									</el-select>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key"><i class="lhadmin lhadmin-wujiaoxing"></i>店铺位置</div>
								<div class="fl list-cont">
									<el-input :value="lng + ',' + lat" disabled></el-input>
								</div>
								<i class="lhadmin lhadmin-dingwei dingwei ml_5" @click="redactBtn"></i>
							</div>
							<div class="row-info clear">
								<div class="fl title-key"><i class="lhadmin lhadmin-wujiaoxing"></i>详细地址</div>
								<div class="fl list-cont">
									<el-input v-model="dataMes.detailed_address"></el-input>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key">所在商圈</div>
								<div class="fl list-cont contentInfo2">
									<el-input v-model="dataMes.city_name" disabled></el-input>
								</div>
								<div class="fl list-cont contentInfo2">
									<el-input v-model="dataMes.area_name" disabled></el-input>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key">负责人邮箱</div>
								<div class="fl list-cont">
									<el-input v-model="dataMes.email" placeholder="请输入"></el-input>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key">销售</div>
								<div class="fl list-cont">
									<el-autocomplete
										class="inline-input"
										v-model="dataMes.bd_name"
										:fetch-suggestions="querySearch"
										placeholder="请输入"
										:trigger-on-focus="true"
										@select="handleSelect"
										@change="clearBd"
										clearable
									></el-autocomplete>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key">联系电话</div>
								<div class="fl list-cont">
									<el-input v-model="dataMes.business_phone" placeholder="请输入" disabled></el-input>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key">员工人数</div>
								<div class="fl list-cont">
									<el-input v-model="dataMes.emp_num" placeholder="请输入"></el-input>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key">桌台数</div>
								<div class="fl list-cont">
									<el-input v-model="dataMes.number_sets" placeholder="请输入"></el-input>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key">人均消费</div>
								<div class="fl list-cont">
									<el-input v-model="dataMes.consumption_person" placeholder="请输入"></el-input>
								</div>
								<div class="fl title-key" style="width: 200px; text-align: left; margin-left: 10px;">元/人</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key">用工高峰时段</div>
								<div class="fl list-cont">
									<el-select v-model="dataMes.time_interval">
										<el-option label="早班 [05:00-09:59]" value="1"></el-option>
										<el-option label="中班 [10:00-14:59]" value="2"></el-option>
										<el-option label="晚班 [15:00-21:59]" value="3"></el-option>
										<el-option label="夜班 [22:00-次日04:59]" value="4"></el-option>
									</el-select>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key">营业时间</div>
								<div class="fl list-cont">
									<el-form label-width="100" class="demo-ruleForm fl">
										<el-form-item required style="margin-bottom: 0px;">
											<el-col :span="11">
												<el-time-select
													v-model="dataMes.start_time"
													:picker-options="{
														start: '00:00',
														step: '00:30',
														end: '24:00'
													}"
													placeholder="开始时间"
												></el-time-select>
											</el-col>
											<el-col class="line" :span="2" style="position: relative; right: -10px;">~</el-col>
											<el-col :span="11">
												<el-time-select
													v-model="dataMes.end_time"
													:picker-options="{
														start: '00:00',
														step: '00:30',
														end: '24:00'
													}"
													placeholder="开始时间"
												></el-time-select>
											</el-col>
										</el-form-item>
									</el-form>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key">公司网址</div>
								<div class="fl list-cont">
									<el-input v-model="dataMes.company_website" placeholder="请输入"></el-input>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key">来源</div>
								<div class="fl list-cont">
									<span>{{ shopInfo.origin_name }}</span>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key">创建时间</div>
								<div class="fl list-cont">
									<span>{{ shopInfo.add_time }}</span>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key">创建人</div>
								<div class="fl list-cont">
									<span>{{ shopInfo.creater_name }}</span>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key">渠道</div>
								<div class="fl list-cont">
									<span>{{ shopInfo.channel }}</span>
								</div>
							</div>
							<div class="row-info clear">
								<div class="fl title-key">拓展者</div>
								<div class="fl list-cont">
									<span>{{ shopInfo.expand_name }}</span>
								</div>
							</div>
						</div>
						<div class="clear"></div>
						<div class="ml_120 mt_80">
							<span class="btnOK" @click="submitBtn(1)">保存</span>
						</div>
					</div>
				</el-tab-pane>
				<!-- 1:企业类型 -->
				<el-tab-pane label="资质材料-企业" v-if="dataMes.type == 1">
					<div class="contentInfo">
						<div class="row-info clear">
							<div class="fl title-key mt_15"><i class="lhadmin lhadmin-wujiaoxing"></i>营业执照</div>
							<div class="fl list-cont">
								<uploadedit
									:pic_name="'business_license'"
									:pic_url="dataMes_zizhi.business_license"
									@func="img1"
								></uploadedit>
							</div>
						</div>
						<div class="row-info clear">
							<div class="fl title-key"><i class="lhadmin lhadmin-wujiaoxing"></i>公司名称</div>
							<div class="fl list-cont">
								<el-input v-model="dataMes_zizhi.company_name" placeholder="请输入"></el-input>
							</div>
						</div>
						<div class="row-info clear">
							<div class="fl title-key"><i class="lhadmin lhadmin-wujiaoxing"></i>营业执照注册号</div>
							<div class="fl list-cont">
								<el-input v-model="dataMes_zizhi.registration_no" placeholder="请输入"></el-input>
							</div>
							<div class="fl title-key" style="width: 200px; text-align: left; margin-left: 10px;">
								（统一社会信用代码）
							</div>
						</div>
						<div class="row-info clear">
							<div class="fl title-key">经营范围</div>
							<div class="fl list-cont">
								<el-input
									type="textarea"
									:rows="4"
									:cols="32"
									placeholder="请输入内容"
									v-model="dataMes_zizhi.business_scope"
								></el-input>
							</div>
						</div>
						<div class="row-info clear">
							<div class="fl title-key">法人姓名</div>
							<div class="fl list-cont">
								<el-input v-model="dataMes_zizhi.name" placeholder="请输入"></el-input>
							</div>
						</div>
						<div class="row-info clear">
							<div class="fl title-key">法人身份证号</div>
							<div class="fl list-cont">
								<el-input v-model="dataMes_zizhi.identity_card" placeholder="请输入"></el-input>
							</div>
						</div>
						<div class="row-info clear">
							<div class="fl title-key mt_15">法人身份证</div>
							<div class="fl list-cont">
								<uploadedit
									pic_name="'dataMes_zizhi.front_pic'"
									:pic_url="dataMes_zizhi.front_pic"
									@func="img2"
								></uploadedit>
							</div>
							<div class="fl list-cont ml_20">
								<uploadedit
									pic_name="'dataMes_zizhi.back_pic'"
									:pic_url="dataMes_zizhi.back_pic"
									@func="img3"
								></uploadedit>
							</div>
						</div>
						<div class="row-info clear">
							<div class="fl title-key mt_15">经营许可证</div>
							<div class="fl list-cont">
								<uploadedit pic_name="'dataMes_zizhi.others'" :pic_url="dataMes_zizhi.others" @func="img4"></uploadedit>
							</div>
						</div>
						<div class="row-info clear">
							<div class="fl title-key">开户行</div>
							<div class="fl list-cont">
								<el-input v-model="dataMes_zizhi.bank_branch_name" placeholder="请输入"></el-input>
							</div>
						</div>
						<div class="row-info clear">
							<div class="fl title-key">银行账号</div>
							<div class="fl list-cont">
								<el-input v-model="dataMes_zizhi.bank_card_id" placeholder="请输入"></el-input>
							</div>
						</div>
						<div class="clear"></div>
						<div class="ml_120 mt_80">
							<span class="btnOK" @click="submitBtn(2)">保存</span>
						</div>
					</div>
				</el-tab-pane>
				<!-- 个人类型 -->
				<el-tab-pane label="资质材料-个人" v-if="dataMes.type == 2">
					<div class="contentInfo">
						<div class="row-info clear">
							<div class="fl title-key"><i class="lhadmin lhadmin-wujiaoxing"></i>身份证号码</div>
							<div class="fl list-cont">
								<el-input v-model="dataMes_zizhi.identity_card" placeholder="请输入"></el-input>
							</div>
						</div>
						<div class="row-info clear">
							<div class="fl title-key mt_15"><i class="lhadmin lhadmin-wujiaoxing"></i>身份证</div>
							<div class="fl list-cont">
								<uploadedit
									pic_name="'dataMes_zizhi.front_pic'"
									:pic_url="dataMes_zizhi.front_pic"
									@func="img2"
								></uploadedit>
							</div>
							<div class="fl list-cont ml_20">
								<uploadedit
									pic_name="'dataMes_zizhi.back_pic'"
									:pic_url="dataMes_zizhi.back_pic"
									@func="img3"
								></uploadedit>
							</div>
						</div>
						<div class="row-info clear">
							<div class="fl title-key mt_15">其他</div>
							<div class="fl list-cont">
								<uploadedit pic_name="'dataMes_zizhi.others'" :pic_url="dataMes_zizhi.others" @func="img4"></uploadedit>
							</div>
							<div class="fl list-cont ml_20">（可上传所持有的行业经营许可证件图片，如：餐饮行业个体户健康证）</div>
						</div>

						<div class="clear"></div>
						<div class="ml_120 mt_80">
							<!-- <span class="resetBtn mr_10" @click="back">返回</span> -->
							<span class="btnOK" @click="submitBtn(2)">保存</span>
						</div>
					</div>
				</el-tab-pane>
			</el-tabs>
		</div>
		<!-- 弹出地图 -->
		<!-- 在地图上标记店铺位置 -->
		<el-dialog
			title="在地图上标记店铺位置"
			:visible.sync="readctRoleShow"
			width="1000px"
			:before-close="close"
			:close-on-click-modal="false"
		>
			<div class="auditCentent">
				<div class="clear">
					<div class="mb_10 roleFunctionBox">
						<div class="pl_10 pb_10">
							<areapickings
								v-if="readctRoleShow"
								@pagedata="onChildValue"
								:inputs="dataMes.name"
								:lngs="lng"
								:lats="lat"
								:areas="dataMes.address"
							></areapickings>
						</div>
					</div>
				</div>
			</div>
		</el-dialog>
	</div>
</template>

<script>
var common = require('../../../static/tool.js')
import { fetchIndustryJob } from '@/api/label.js'
import {
	fetchShopInfo,
	fetchBusinessForSearch,
	fetchBusinessUser,
	setAddBasicEdit,
	setAddQualificationEdit
} from '@/api/shop.js'
import { searchAgentList } from '@/api/agent.js'
import { fetchCityArea, createCity } from '@/api/city.js'

export default {
	name: 'MerchantsEdit',
	data() {
		return {
			manageInfo: JSON.parse(sessionStorage.getItem('manageInfo')), //登录信息
			url: common.url,
			cityList: [], //城市列表
			id: '',
			shopInfo: {},
			//相关数据
			dataMes: {
				// 第一页的数据
				type: '', //商铺类型
				logo: '', //logo
				business_sn: '', //唯一的code
				business_id: '', //所属商户id
				business_name: '', //所属商户name
				name: '', //店铺名称
				industry: '', //所属行业 [1]餐饮
				emp_num: '', //员工人数
				number_sets: '', //桌台数
				consumption_person: '', //人均消费
				time_interval: '', //高峰时段 1、2、3、4早、中、晚、夜
				start_time: '', //营业时间-开始
				end_time: '', //营业时间-结束
				address: '', //地址
				detailed_address: '', //地址
				city_id: '', //城市ID
				city_name: '', //城市
				area_id: '', //区域id
				area_name: '', //区域
				email: '', //负责人邮箱
				company_website: '', //网址
				bd_name: '', //销售
				bd_userid: '', //销售ID
				bd_phone: '', //销售手机
				business_phone: '', //联系电话
				coordinates_list: {}, //新增的位置坐标
				agent_id: ''
			},
			dataMes_zizhi: {
				// 第二页的数据
				id: '', //对应的商铺id
				// type同上
				company_name: '', //公司名
				business_license: '', //营业执照
				registration_no: '', //信用代码
				business_scope: '', //经营范围
				name: '', //法人
				bank_branch_name: '', //开户行
				bank_card_id: '', //卡号
				identity_card: '', //身份证号码
				front_pic: '', //身份证正面
				back_pic: '', //身份证反面
				others: [] //其他资质多个用[,]拼接
			},

			MerchantsList: [], //商户列表
			BusinessUserList: [], //销售列表

			readctRoleShow: false, //区域框架的显示隐藏
			lng: '',
			lat: '',

			industryJobList: [],
			agentList: []
		}
	},

	mounted() {
		this.id = this.$route.query.id //接收传参
		this.getshopinfo()
		this.getMerchants() //商户列表
		this.getList() //代理商列表
	},
	methods: {
		//获取总的信息
		async getshopinfo() {
			try {
				let res = await fetchShopInfo({
					id: this.id
				})
				var allmes = res
				this.shopInfo = res
				this.dataMes.business_sn = allmes.business_sn //business_sn
				this.dataMes.type = allmes.type //商铺类型
				this.dataMes.business_id = allmes.business_id //所属商户id
				this.dataMes.business_name = allmes.business_name //所属商户name
				this.dataMes.name = allmes.shop_name //店铺名称
				this.dataMes.emp_num = allmes.emp_num //店铺负责人手机号
				this.dataMes.industry = allmes.industry_id //所属行业 [1]餐饮
				this.dataMes.number_sets = allmes.number_sets //员工人数
				this.dataMes.number_sets = allmes.number_sets //桌台数
				this.dataMes.consumption_person = allmes.consumption_person //人均消费
				this.dataMes.time_interval = allmes.time_interval.toString() //高峰时段 1、2、3、4早、中、晚、夜
				this.dataMes.start_time = allmes.start_time //营业时间-开始
				this.dataMes.end_time = allmes.end_time //营业时间-结束
				this.dataMes.address = allmes.address //地址
				this.dataMes.detailed_address = allmes.detailed_address //地址
				this.dataMes.city_id = allmes.city_id //城市ID
				this.dataMes.city_name = allmes.city_name //城市
				this.dataMes.area_id = allmes.area_id //区域ID
				this.dataMes.area_name = allmes.area_name //区域
				this.dataMes.email = allmes.email //负责人邮箱
				this.dataMes.company_website = allmes.company_website //网址
				this.dataMes.bd_name = allmes.business_director //销售
				this.dataMes.bd_userid = allmes.business_director_id //销售ID
				this.dataMes.bd_phone = allmes.business_phone //销售手机
				this.dataMes.business_phone = allmes.business_phone //联系电话
				this.dataMes.coordinates_list = allmes.location //坐标位置
				this.dataMes.agent_id = +allmes.agent_id
				// 第二页：
				this.dataMes_zizhi.company_name = allmes.company_name //公司名
				this.dataMes_zizhi.business_license = allmes.business_license //营业执照
				this.dataMes_zizhi.registration_no = allmes.registration_no //信用代码
				this.dataMes_zizhi.business_scope = allmes.business_scope //经营范围
				this.dataMes_zizhi.name = allmes.name //法人
				this.dataMes_zizhi.bank_branch_name = allmes.bank_branch_name //开户行
				this.dataMes_zizhi.bank_card_id = allmes.bank_card_id //卡号
				this.dataMes_zizhi.identity_card = allmes.identity_card //身份证号码
				this.dataMes_zizhi.front_pic = allmes.front_pic //身份证正面
				this.dataMes_zizhi.back_pic = allmes.back_pic //身份证反面
				this.dataMes.logo = allmes.logo //logo
				// this.dataMes_zizhi.others = allmes.others //其他资质多个用[,]拼接
				// 多个取第一个
				if (allmes.others.length > 0) {
					this.dataMes_zizhi.others = allmes.others[0]
				} else {
					this.dataMes_zizhi.others = ''
				}

				//相关经纬度信息的返回
				this.lat = allmes.lat
				this.lng = allmes.lng

				this.getIndustryJob()
				this.getBusinessUser() //销售列表
			} catch (err) {
				console.log(err)
			}
		},
		//获取商户列表
		async getMerchants() {
			try {
				let res = await fetchBusinessForSearch({
					status: '1',
					fields: 'id,name,type,business_sn'
				})
				res.list.forEach(item => {
					item.value = item.name
				})
				this.MerchantsList = res.list
			} catch (err) {
				console.log(err)
			}
		},
		//获取销售列表
		async getBusinessUser() {
			try {
				let res = await fetchBusinessUser({
					agent_id: this.dataMes.agent_id
				})
				res.forEach(item => {
					item.value = item.nickname
				})
				this.BusinessUserList = res
			} catch (err) {
				console.log(err)
			}
		},

		submitBtn(e) {
			//提交表单数据
			if (e == 1) {
				// 第一步的保存提交
				if (
					this.dataMes.business_name == '' || //所属商户
					this.dataMes.name == '' || //店铺名称
					this.dataMes.detailed_address == '' || //地址
					this.dataMes.industry === '' //行业
				) {
					this.$message.error('请填写必填项')
					return
				}

				// 第一步的提交
				this.basicInfoSave()
			} else if (e == 2) {
				// 第二步的保存提交
				if (this.dataMes.type == 1) {
					//企业
					if (
						this.dataMes_zizhi.business_license == '' ||
						this.dataMes_zizhi.company_name == '' ||
						this.dataMes_zizhi.registration_no == ''
					) {
						this.$message.error('请填写必填项')
						return
					}
				} else {
					//个人
					if (
						this.dataMes_zizhi.identity_card == '' ||
						this.dataMes_zizhi.front_pic == '' ||
						this.dataMes_zizhi.back_pic == ''
					) {
						this.$message.error('请填写必填项')
						return
					}
				}
				// 第二步的提交
				this.materialsSave()
			}
		},
		async basicInfoSave() {
			try {
				await setAddBasicEdit({
					id: this.id,
					type: this.dataMes.type,
					business_id: this.dataMes.business_id,
					business_sn: this.dataMes.business_sn,
					name: this.dataMes.name,
					industry: this.dataMes.industry,
					emp_num: this.dataMes.emp_num,
					number_sets: this.dataMes.number_sets,
					consumption_person: this.dataMes.consumption_person,
					time_interval: this.dataMes.time_interval,
					start_time: this.dataMes.start_time || '',
					end_time: this.dataMes.end_time || '',
					address: '',
					detailed_address: this.dataMes.detailed_address,
					city_id: this.dataMes.city_id,
					city_name: this.dataMes.city_name,
					area_id: this.dataMes.area_id,
					area_name: this.dataMes.area_name,
					email: this.dataMes.email,
					company_website: this.dataMes.company_website,
					business_director: this.dataMes.bd_name,
					business_director_id: this.dataMes.bd_userid,
					bd_phone: this.dataMes.bd_phone,
					business_phone: this.dataMes.business_phone,
					agent_id: this.dataMes.agent_id,
					logo: this.dataMes.logo,
					lng: this.lng,
					lat: this.lat,
					form: 'shop'
				})
				this.$message.success('保存成功')
				this.getshopinfo()
			} catch (err) {
				console.log(err)
			}
		},
		async materialsSave() {
			try {
				await setAddQualificationEdit({
					id: this.id,
					type: this.dataMes.type,
					company_name: this.dataMes_zizhi.company_name,
					business_license: this.dataMes_zizhi.business_license,
					registration_no: this.dataMes_zizhi.registration_no,
					business_scope: this.dataMes_zizhi.business_scope,
					name: this.dataMes_zizhi.name,
					bank_branch_name: this.dataMes_zizhi.bank_branch_name,
					bank_card_id: this.dataMes_zizhi.bank_card_id,
					identity_card: this.dataMes_zizhi.identity_card,
					front_pic: this.dataMes_zizhi.front_pic,
					back_pic: this.dataMes_zizhi.back_pic,
					others: this.dataMes_zizhi.others.toString()
				})
				this.$message.success('保存成功')
				this.getshopinfo()
			} catch (err) {
				console.log(err)
			}
		},

		//子组件过来的值
		async onChildValue(item) {
			try {
				this.lng = item[0]
				this.lat = item[1]
				this.dataMes.address = item[2]

				let ret = await fetchCityArea({ lng: this.lng, lat: this.lat, source: 'shop' })
				if (ret) {
					this.dataMes.city_id = ret.city_id
					this.dataMes.city_name = ret.city_name
					this.dataMes.area_id = ret.id
					this.dataMes.area_name = ret.area_name
					this.dataMes.coordinates_list = ret.coordinates_list
					this.dataMes.industry = ''
					this.getIndustryJob()
				} else {
					this.dataMes.area_id = ''
					this.dataMes.area_name = ''
					this.dataMes.coordinates_list = {}
					this.createCityFunction()
				}
			} catch (err) {
				console.log(err)
			} finally {
				this.close()
			}
		},
		//创建城市
		async createCityFunction() {
			try {
				let ret = await createCity({ lng: this.lng, lat: this.lat })
				this.dataMes.city_id = ret.city_id
				this.dataMes.city_name = ret.city_name
				this.getIndustryJob()
			} catch (err) {
				console.log(err)
			}
		},
		redactBtn(row) {
			//编辑
			this.readctRoleShow = true //显示区域框
		},
		close() {
			this.readctRoleShow = false //隐藏区域框
		},
		back() {
			//返回
			this.$router.go(-1)
		},
		//自动完成
		querySearch(queryString, cb) {
			var restaurants = this.BusinessUserList
			var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants
			// 调用 callback 返回建议列表的数据
			cb(results)
		},
		createFilter(queryString) {
			return restaurant => {
				return restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
			}
		},
		handleSelect(item) {
			this.dataMes.bd_name = item.nickname
			this.dataMes.bd_userid = item.user_id
			this.dataMes.business_phone = item.mobile
		},
		clearBd(ev) {
			console.log(ev)
			if (ev == '') {
				this.dataMes.bd_name = ''
				this.dataMes.bd_userid = ''
			}
		},

		//自动完成=商户列表
		querySearch_s(queryString, cb) {
			var restaurants = this.MerchantsList
			var results = queryString ? restaurants.filter(this.createFilter_s(queryString)) : restaurants
			// 调用 callback 返回建议列表的数据
			cb(results)
		},
		createFilter_s(queryString) {
			return restaurant => {
				return restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
			}
		},
		handleSelect_s(item) {
			console.log(item)
			this.dataMes.type = item.type
			this.dataMes.business_name = item.name
			this.dataMes.business_id = item.id
			this.dataMes.business_sn = item.business_sn
		},

		img1(data) {
			this.dataMes_zizhi.business_license = data
		},
		img2(data) {
			this.dataMes_zizhi.front_pic = data
		},
		img3(data) {
			this.dataMes_zizhi.back_pic = data
		},
		img4(data) {
			this.dataMes_zizhi.others = data
			// this.dataMes_zizhi.others.push(data)
		},
		img5(data) {
			this.dataMes.logo = data
		},
		async getIndustryJob() {
			try {
				let ret = await fetchIndustryJob({
					city_id: this.dataMes.city_id
				})

				this.industryJobList = ret
			} catch (err) {
				console.log(err)
			}
		},
		async getList() {
			try {
				let ret = await searchAgentList({ status: 1 })
				this.agentList = ret.list.map(it => {
					return {
						id: it.id,
						name: it.name,
						value: it.name,
						city_list: it.city_list
					}
				})
			} catch (err) {
				console.log(err)
			}
		}
	},
	filters: {}
}
</script>

<style scoped>
.personnelAdd {
	margin: 15px 15px 0 15px;
}
.row-info {
	padding: 10px 0;
}
.resetBtn,
.btnOK {
	padding: 0 30px;
}
.title-key {
	width: 115px;
}
.list-cont img {
	width: 128px;
}
.el-upload__text span {
	color: var(--red3);
}
.dingwei {
	font-size: 26px;
	color: var(--btn);
}
.select-sign {
	margin-top: 30px;
	display: flex;
}
.jurisdiction .el-checkbox {
	width: 120px !important;
}
.jurisdiction .sign-key {
	width: 150px;
	text-align: right;
}
</style>



// WEBPACK FOOTER //
// src/components/shop/ShopTag.vue